const MYSQL = require("../../../../sql");
const SqlName = "shopping_service";
/**
 * 订单信息
 * @param {object} params
 * @param {string} params.id 服务ID
 * @returns {Promise<{code:string,msg:string}>}
 */
module.exports = async (params = {}) => {
  try {
    let { page = 1, limit = 10 } = params;
    let query = `
    SELECT * FROM ${SqlName}
    `;
    let result = await MYSQL.promise().query(query);
    let list = result[0];
    return {
      code: 0,
      msg: "获取成功",
      data: {
        page,
        limit,
        data: list,
      },
    };
  } catch (error) {
    throw error;
  }
};
